/*
 * menuPlaylist.h
 *
 *  Created on: 18-oct-2008
 *      Author: hector
 */

#ifndef MENUPLAYLIST_H_
#define MENUPLAYLIST_H_

#include <stdlib.h>
#include <string.h>

#include "menu.h"
#include "libmpdclient.h"
#include "util.h"
#include "sdl.h"
#include "errorscreen.h"


#define FILE_DESC_SIZE 512
#define PATH_SIZE 1024
#define MAX_FILES_DIRECTORIES 512



menu * createFilesMenu();

int handleXFilesMenu(void*, mpd_Connection*);
int handleTFilesMenu(void*, mpd_Connection*);
int handleSFilesMenu(void*, mpd_Connection*);
int handleCFilesMenu(void*, mpd_Connection*);

int handleUpFilesMenu(void*, mpd_Connection*);
int handleDownFilesMenu(void*, mpd_Connection*);

int handleRTFilesMenu(void*, mpd_Connection*);
int handleLTFilesMenu(void*, mpd_Connection*);

int initFilesMenu(void*, mpd_Connection*);
int paintFilesMenu(void*, mpd_Connection*);

int aboutToShowFilesMenu(void*, mpd_Connection*);
int aboutToHideFilesMenu(void*, mpd_Connection*);

int destroyFilesMenu(void*, mpd_Connection*);

typedef struct {
	char path[PATH_SIZE];
	char description[FILE_DESC_SIZE];
	int isDirectory;

} FileMenuEntry;

typedef struct {
	int selectedLine;
	int previouslySelectedLine[10];
	int previousSelectedLineHistoryIndex;
	int lines;
	char currentPath[PATH_SIZE];
	FileMenuEntry entries[MAX_FILES_DIRECTORIES];

} FilesMenuState;

#endif /* MENUPLAYLIST_H_ */
